//
//  LBCouresePackageCell.m
//  V-Learn
//
//  Created by Apple on 2019/1/3.
//  Copyright © 2019 yxk. All rights reserved.
//

#import "LBCouresePackageCell.h"

@implementation LBCouresePackageCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self setupUI];
    }
    return self;
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *identifferCell = @"LBCouresePackageCell";
    LBCouresePackageCell *cell = [tableView dequeueReusableCellWithIdentifier:identifferCell];
    if (!cell) {
        cell = [[LBCouresePackageCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifferCell];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
    }
    
    
    return cell;
}
- (void)setupUI{

    self.titleLab = [UILabel labelWithText:@"双语课程第一季" andTextColor:rgb(51,51,51) andName:nil andFontSize:15*kScaleFit];
    
    [self.contentView addSubview:self.titleLab];
    [self.titleLab makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15*kScaleFit);
        make.top.mas_equalTo(10*kScaleFit);
    }];
    
    self.detailLab = [UILabel labelWithText:@"这是一套符合孩子年龄特点、认知特点和心理特点的家庭教育解决方案，是在语言学、儿童心理学基础上研发出来的科学的语言学习体系，它改变了中国三十年来无论是成人学生还是学龄前儿童都在背单词、学对话的学习模式，是真正做到从启蒙良好的“语感”开始形成良好的语言应用能力，让母语与第二语言同步发展。" andTextColor:rgb(102,102,102) andName:nil andFontSize:14*kScaleFit];
    self.detailLab.numberOfLines = 0;
    [self.contentView addSubview:self.detailLab];
    [self.detailLab makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15*kScaleFit);
        make.right.mas_equalTo(-10*kScaleFit);
        make.bottom.mas_equalTo(-20*kScaleFit);
        make.top.mas_equalTo(self.titleLab.mas_bottom).mas_equalTo(10*kScaleFit);
    }];
    //
    
}
- (void)setModel:(LBCourseOutputDTOListModel *)model{
    _model = model;
    self.detailLab.text = model.coursePresent;
    self.titleLab.text = model.courseName;
}
@end
